<?php


namespace Xiaoguai\DesignPattern\DP010;


abstract class AbstractHandler
{
    /**
     * @var AbstractHandler $next
     */
    protected $next;

    /**
     * @param AbstractHandler $next
     */
    public function setNext(AbstractHandler $next): void
    {
        $this->next = $next;
    }

    /**
     * @return AbstractHandler
     */
    public function getNext(): AbstractHandler
    {
        return $this->next;
    }

    abstract public function handleRequest(string $request);
}